<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
<%@include file="/WEB-INF/jsp/public/commons.jspf"%>
    <title>所有消息</title>
 
  </head>
  <script type="text/javascript">
  	function deleteall() {
		if(confirm("确定删除吗？")==true){
			return true;
		}else{
			return false;
		}
	}
  </script>
  <body>
   <%-- <jsp:include page="/WEB-INF/jsp/personalAction/personalTitle.jsp"></jsp:include> --%>
	<br>
	<div class="container">
  <div><h3>全部消息</h3></div><hr>
	<form action="message_delete.action" method="post">
		<div>
			&nbsp;
			<input type="submit" value="批量删除" class="btn btn-default" onclick="javascript:return deleteall();">
			<a href="message_deleteall.action" class="btn btn-default" onclick="javascript:return deleteall();">删除所有消息</a>
			<a href="message_markall.action" class="btn btn-default ">全部标记为已读</a>
		</div><br>
		<table class="table table-condensed">
			<thead>
				<tr style="background-color:rgba(0, 0, 0, 0.1);">
					<td><input type="checkbox" style="float: right;" onclick="checkall()" /></td>
					<td></td>
					<th>投诉主题</th>
					<th>投诉物业</th>
					<th>最后一次处理时间</th>
					<th>处理状态</th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="recordList" status="obj">
					<tr>
						<s:set value="recordList[#obj.index][0].id" var="mid" />
						<td><input type="checkbox" name="checkmessage" value="${mid}"
							style="float: right;" /></td>
						<td><s:if test="recordList[#obj.index][0].status=='已读'">
								<img title="已读" src="images/open.png"
									style="width: 20px;float: right">
							</s:if> <s:else>
								<img title="未读" src="images/close.png"
									style="width: 20px;float: right">
							</s:else></td>
						<td><s:property value="recordList[#obj.index][1].complaint" /></td>
						<td><s:property value="recordList[#obj.index][2].name" /></td>
						<td><s:date name="recordList[#obj.index][0].date"
								format="yyyy-MM-dd HH:mm:ss" /></td>
						<td><s:if test="recordList[#obj.index][0].progress==0">待处理</s:if>
							<s:elseif test="recordList[#obj.index][0].progress==1" >处理中</s:elseif>
							<s:else >处理完成</s:else>
						<br>
							<a href="message_view.action?id=${mid}"
							class="btn btn-info btn-xs" role="button">处理详情</a></td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
	</form>
	<%@include file="/WEB-INF/jsp/public/pageView.jspf"%>
	<form id="pageCondition" action="message_all.action"></form>
	<script type="text/javascript">
 	var isCheckAll = false;  
        function checkall() {  
            if (isCheckAll) {  
                $("input[type='checkbox']").each(function() {  
                    this.checked = false;  
                });  
                isCheckAll = false;  
            } else {  
                $("input[type='checkbox']").each(function() {  
                    this.checked = true;  
                });  
                isCheckAll = true;  
            }  
        }  
 </script>
 </div>
</body>

</html>
